package com.yaowk.service.mall.clothing.entity;

import com.yaowk.service.common.BaseEntity;
import com.yaowk.service.file.entity.TSource;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import java.util.Set;

/**
 * 商品图片资源关系
 */
@Setter
@Getter
@ToString
@Entity
@DynamicInsert
@DynamicUpdate
public class CmImage extends BaseEntity<Long> {

    @OneToOne
    private TSource source;
    @ManyToMany(mappedBy = "images")
    private Set<CmGoods> goods;
}
